package com.lu.adog.util;

import android.util.Log;

/**
 * @author Yue
 * @date 2017/11/15 17:08
 */

public class Logg {

    private static boolean loggable = true;

    public static boolean isLoggable() {
        return loggable;
    }

    public static void setLoggable(boolean loggable) {
        Logg.loggable = loggable;
    }

    public static boolean isDebuggable() {
        return loggable;
    }

    public static int i(String tag, Object msg) {
        if (!loggable)
            return -1;
        return Log.i(tag, msg + "");
    }

    public static int i(String tag, Object msg, Throwable tr) {
        if (!loggable)
            return -1;
        return Log.i(tag, msg + "", tr);
    }

    public static int d(String tag, Object msg) {
        if (!loggable)
            return -1;
        return Log.d(tag, msg + "");
    }

    public static int d(String tag, Object msg, Throwable tr) {
        if (!loggable)
            return -1;
        return Log.d(tag, msg + "", tr);
    }

    public static int e(String tag, Object msg) {
        if (!loggable)
            return -1;
        return Log.e(tag, msg + "");
    }

    public static int e(String tag, Object msg, Throwable tr) {
        if (!loggable)
            return -1;
        return Log.e(tag, msg + "", tr);
    }

    public static int w(String tag, Object msg, Throwable tr) {
        if (!loggable)
            return -1;
        return Log.w(tag, msg + "", tr);
    }

    public static int w(String tag, Object msg) {
        if (!loggable)
            return -1;
        return Log.w(tag, msg + "");
    }

    public static int a(String tag, Object msg) {
        if (!loggable) {
            return -1;
        }
        return Log.wtf(tag, msg+"");
    }

    public static int a(String tag, Object msg, Throwable tr) {
        if (!loggable) {
            return -1;
        }
        return Log.wtf(tag, msg+"", tr);
    }

    public static int a(String tag, Throwable tr) {
        if (!loggable) {
            return -1;
        }
        return Log.wtf(tag, tr);
    }

}
